-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(ConfigReader): Use CLI options with default config file #404
Conversation
Change ConfigReader behavior to always use stryker.conf.js if present. CLI options override options from the file. Run does not fail anymore if a CLI option, but no config file is specified. closes stryker-mutator#390
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! I still have some small remarks.
packages/stryker/src/ConfigReader.ts
Outdated
|
||
if (!this.cliOptions.configFile) { | ||
try { | ||
fs.accessSync(`${process.cwd()}/${DEFAULT_CONFIG_FILE}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's cleaner to use path.resolve(`./${DEFAULT_CONFIG_FILE}`)
here.
packages/stryker/src/ConfigReader.ts
Outdated
log.info(`Using ${DEFAULT_CONFIG_FILE} in the current working directory.`); | ||
this.cliOptions.configFile = DEFAULT_CONFIG_FILE; | ||
} catch (e) { | ||
log.info('No config file specified. Running with command line arguments.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we also add a message: 'Use `stryker init` command to generate your config file'
here? So we help the end user even more?
Awesome! You got #404 🥇 |
Display 'Use `stryker init` command to generate your config file.' when stryker is run without a config file.
Thanks @Be-ngt-oH . Awesome job 🥇 |
Change ConfigReader behavior to always use stryker.conf.js if present. CLI
options override options from the file.
Run does not fail anymore if a CLI option, but no config file is specified.
closes #390